Skip to content

Conversation

@TRomesh
Copy link
Contributor

@TRomesh TRomesh commented Oct 16, 2025

This template is 75% complete. The remaining features can be implemented once the tasks in CMS-46339 are resolved.

@TRomesh TRomesh force-pushed the feature/CMS-45730-add-alloy-template branch from 0277cd3 to 1458a0a Compare October 21, 2025 09:45
@TRomesh TRomesh marked this pull request as ready for review October 30, 2025 07:30
@TRomesh TRomesh requested a review from exacs October 30, 2025 12:00
@TRomesh TRomesh enabled auto-merge November 4, 2025 07:54
@TRomesh TRomesh requested a review from Copilot November 4, 2025 10:03
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new alloy-template to the templates directory, providing a Next.js-based starter template for Optimizely CMS projects. The template includes pre-configured components, TypeScript configuration, and Tailwind CSS styling.

  • Adds a complete Next.js 15.5.4 template with React 19.1.0
  • Includes various reusable CMS components (Teaser, Notice, Contact, etc.)
  • Configures TypeScript, Tailwind CSS v4, and PostCSS
  • Updates workspace configuration to include the templates directory

Reviewed Changes

Copilot reviewed 28 out of 36 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
templates/alloy-template/package.json Defines project dependencies including Next.js, React 19, and Tailwind CSS v4
templates/alloy-template/tsconfig.json TypeScript configuration with Next.js and bundler module resolution
templates/alloy-template/src/components/*.tsx Component files for Teaser, Notice, Contact, Editorial, Article, and other CMS content types
templates/alloy-template/src/components/Start.tsx Start page component with composition support
templates/alloy-template/src/app/*.tsx Next.js app router pages including layout, dynamic routes, and preview
templates/alloy-template/next.config.ts Next.js configuration for remote image patterns
pnpm-workspace.yaml Updated to include templates directory in workspace
pnpm-lock.yaml Lock file updated with new template dependencies
Files not reviewed (2)
  • pnpm-lock.yaml: Language not supported
  • templates/alloy-template/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +3 to +6
const PageList = contentType({
key: 'PageListBlock',
displayName: '',
description: '',
Copy link

Copilot AI Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The displayName and description fields are empty strings. These should be populated with meaningful values to improve the component's discoverability and documentation in the CMS. Consider setting displayName: 'Page List Block' and providing a helpful description.

Copilot uses AI. Check for mistakes.
Comment on lines +138 to +139
console.log(opti.image?.url.default);

Copy link

Copilot AI Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debug console.log statement should be removed before production. This appears to be leftover debugging code.

Suggested change
console.log(opti.image?.url.default);

Copilot uses AI. Check for mistakes.
}

function StartPage({ opti }: StartPageProps) {
const { pa } = getPreviewUtils(opti);
Copy link

Copilot AI Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused variable pa.

Suggested change
const { pa } = getPreviewUtils(opti);

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,52 @@
import { contentType } from '@optimizely/cms-sdk';

const PageList = contentType({
Copy link

Copilot AI Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused variable PageList.

Copilot uses AI. Check for mistakes.
} from '@optimizely/cms-sdk/react/server';

export const StandardContentType = contentType({
key: 'Standard',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We seem to be a bit inconsistent with content type naming. Some content types have the suffix 'Page' and some not.

key: 'Standard',
displayName: 'Standard Page',
baseType: '_experience',
mayContainTypes: ['_self', 'News'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it not possible to combine strings with objects, like mayContainTypes: ['_self', News]?

type: 'string',
displayName: 'Page Description',
},
disable_indexing: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SEO properties should probably be grouped into a block/component. Then use the block as a property on page types. Might make more sense to define them in a contract when we have that support, but until then a block property makes sense.

We have both title and site_title. Same with description.

displayName: 'Button Link',
group: 'Information',
},
button_text: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this button really needed? If yes, then define it as a block/compontent and use it as a block property rather than two separate properties here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants